<template>
	<view class="Startup">
		<view class="Startup-bottom">
			<image src="../../static/logos.png" mode=""></image>
			<text>涞了么优选</text>
			<text>|</text>
			<text>全新升级2.0</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time: 2
			}
		},
		onLoad() {
			debugger
			try {
				const value = uni.getStorageSync('qidongqi');
				if (value) {
					this.init()
				} else {
					uni.setStorageSync('qidongqi', 'hello');
					this.time = 2
					const timer = setInterval(() => {
						this.time--
						if (this.time <= 0) this.init()
					}, 1000)
					this.$once('hook:beforeDestroy', () => {
						clearInterval(timer)
					})
				}
			} catch (e) {
				// error
			}
		},
		methods: {
			init() {
				uni.switchTab({
					url: '/pages/index/indexs'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.Startup {
		width: 750rpx;
		height: 100vh;
		background-color: #FFFFFF;
		position: relative;

		&-bottom {
			position: absolute;
			bottom: 60rpx;
			width: 750rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			text {
				color: #36B542;
				margin-left: 10rpx;
				font-size: 40rpx;

				&:first-child {
					letter-spacing: 2rpx;
				}

				&:last-child {
					font-size: 28rpx;
					margin-left: 18rpx;
				}
			}
		}

		image {
			width: 50rpx;
			height: 50rpx;
		}
	}
</style>
